﻿package mortal.game.view.tianDiRank.panel
{
    import com.mui.controls.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.component.window.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.tianDiRank.data.*;
    import mortal.game.view.tianDiRank.item.*;
    import mortal.mvc.core.*;

    public class TianDiRankPosDetail extends BaseWindow
    {
        protected var _bg:GImageBitmap;
        protected var _list:CellsGridSprite;
        protected var _cloBtn:GLoadingButton;
        private static var _instance:TianDiRankPosDetail;

        public function TianDiRankPosDetail()
        {
            this.setSize(890, 370);
            this.title = "" + Language.getString(71975);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._bg = UIFactory.gImageBitmap(ImagesConst.TianDiRankPosAttBigBg, 9, 38, this);
            this._list = UIFactory.getUICompoment(CellsGridSprite);
            this._list.colNum = 3;
            this._list.vCellWid = 290;
            this._list.hCellWid = 140;
            this._list.genCellFun = UIFactory.getUICompoment;
            this._list.genCells(5, TianDiRankPosDeCell);
            this._list.x = 19;
            this._list.y = 48;
            this.addChild(this._list);
            this._cloBtn = UIFactory.gLoadingButton(ImagesConst.LineOffCopyCellBtn_upSkin, 410, 328, 80, 32, this);
            this._cloBtn.label = "" + Language.getString(71976);
            this._cloBtn.configEventListener(MouseEvent.CLICK, this.onCloseHd);
            Dispatcher.dispatchEvent(new DataEvent(EventName.TianDiRankEnterInfoReq));
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._bg = null;
            this._list = null;
            this._cloBtn = null;
            return;
        }// end function

        public function updateCells(param1:Boolean) : void
        {
            var _loc_4:Object = null;
            var _loc_5:TianDiRankPosDeCell = null;
            var _loc_2:* = TianDiRankUtil.getPosListInfo();
            var _loc_3:int = 0;
            while (_loc_3 < this._list.cellArr.length)
            {
                
                _loc_4 = _loc_2[_loc_3];
                _loc_5 = this._list.cellArr[_loc_3];
                _loc_5.updateCells(param1, _loc_4, _loc_3);
                _loc_3++;
            }
            return;
        }// end function

        private function onCloseHd(event:MouseEvent) : void
        {
            this.hide();
            return;
        }// end function

        public static function get instance() : TianDiRankPosDetail
        {
            if (_instance == null)
            {
                _instance = new TianDiRankPosDetail;
            }
            return _instance;
        }// end function

    }
}
